package com.heiye.user.biz.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Objects;

/**
 * @author: heiye
 * @date: 2025/02/24 下午4:34
 * @version: v1.0.0
 * @description: 注册类型枚举
 */
@Getter
@AllArgsConstructor
public enum RegisterTypeEnum {
    // 手机验证码
    PHONE(1),
    // 邮箱验证码
    EMAIL(2),
    ;

    private final Integer value;

    public static RegisterTypeEnum valueOf(Integer code) {
        for (RegisterTypeEnum registerTypeEnum : RegisterTypeEnum.values()) {
            if (Objects.equals(code, registerTypeEnum.getValue())) {
                return registerTypeEnum;
            }
        }
        return null;
    }
}
